
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>登入</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="/res/layui/css/layui.css">
  <link rel="stylesheet" href="/res/css/global.css">
</head>
<body>

<div class="fly-header layui-bg-black">
  <div class="layui-container">
    <a class="fly-logo" href="/">
      <img src="/images/logo.png" alt="layui" style="width: 105px;">
    </a>
    <ul class="layui-nav fly-nav-user" id="tabYe">

    </ul>
  </div>
</div>

<div class="layui-container fly-marginTop">
  <div class="fly-panel fly-panel-user" pad20>
    <div class="layui-tab layui-tab-brief" lay-filter="user">
      <ul class="layui-tab-title">
        <li class="layui-this">登入</li>
        <li><a href="reg.html">注册</a></li>
      </ul>
      <div class="layui-form layui-tab-content" id="LAY_ucm" style="padding: 20px 0;">
        <div class="layui-tab-item layui-show">
          <div class="layui-form layui-form-pane">
              <div class="layui-form-item">
                <label for="L_email" class="layui-form-label">用户名</label>
                <div class="layui-input-inline">
                  <input type="text" id="L_email" name="email" placeholder="" required lay-verify="required" autocomplete="off" class="layui-input">
                </div>
              </div>
              <div class="layui-form-item">
                <label for="L_pass" class="layui-form-label">密　码</label>
                <div class="layui-input-inline">
                  <input type="password" id="L_pass" name="pass" placeholder="" required lay-verify="required" autocomplete="off" class="layui-input">
                </div>
              </div>
              <div class="layui-form-item">
                <button class="layui-btn" lay-filter="*" onclick="login()">立即登录</button>
              </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

<div class="fly-footer">
  <p> 2018 &copy; <a href="https://gitee.com/chaofan2685_admin" target="_blank">炒饭 出品</a></p>
  <p>
    <a href="http://www.lishiots.com/" target="_blank">力石科技</a>
    <a href="tencent://message/?uin=894195915&Site=http://vps.shuidazhe.com&Menu=yes">交个朋友</a>
    <a href=mailto:chaofan2685@qq.com>问题反馈</a>
  </p>
</div>


<!--<script src="/res/layui/layui.js"></script>-->
<script src="/res/layui/layui.all.js"></script>
<script src="/js/jquery.min.js"></script>
<script src="/js/common.variate.js"></script>
<script src="/js/common.method.js"></script>
<script src="/js/md5.js"></script>
<script>

  function login() {
      var userName = document.getElementById('L_email').value;
      var password = md5(document.getElementById('L_pass').value);
      if (isEmpty(userName)||isEmpty(password)){
          layer.msg("必填项不能为空",{anim: 6});
          return false;
      }
      $.ajax({
          type: "POST",
          url: "/api/user/login",
          data: {userName:userName,password:password},
          dataType: "json",
          success: function(data){
              if (data.code == '8200'){
                  location.href = "/index.html"
              }else {
                  layer.msg(data.message,{anim: 6});
              }
          }
      });
  }




</script>

</body>
</html>